Skip to content

Utbot-Python refactoring #2366

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 45 commits into from
Jul 27, 2023
Merged

Conversation

tamarinvs19
Copy link
Collaborator

@tamarinvs19 tamarinvs19 commented Jul 4, 2023

Description

Refactored utbot-python test generation structure

  • Supported named arguments and named-only arguments
  • Supported named arguments in magic-methods
  • Fixed code generation for pytest
  • Rewrote requirements installation process
  • Updated readme
  • Removed unused code
  • Fixed deep equals asserts code generation
  • Updated example testset and created script to generate tests and check coverage (utbot-python/samples/run_tests.py)
  • Added CLI parameter --do-not-generate-regression-suite
  • Added CLI parameter --runtime-exception-behaviour [PASS|FAIL]

How to test

Manual tests

  • For named arguments: see samples/named_arguments/named_arguments.py: tests should use named arguments (include __pow__ and __round__ methods)
  • Asserts for pytest with True / False / None use is instead of ==
  • Before requirements installation utbot should show list of modules and then show notification about success installation

Self-check list

Check off the item if the statement is true. Hint: [x] is a marked item.

Please do not delete the list or its items.

  • I've set the proper labels for my PR (at least, for category and component).
  • PR title and description are clear and intelligible.
  • I've added enough comments to my code, particularly in hard-to-understand areas.
  • The functionality I've repaired, changed or added is covered with automated tests.
  • Manual tests have been provided optionally.
  • The documentation for the functionality I've been working on is up-to-date.

@tamarinvs19 tamarinvs19 added comp-codegen Issue is related to code generator ctg-refactoring Issue related to refactoring process lang-python Issue is related to python support labels Jul 4, 2023
@tamarinvs19 tamarinvs19 self-assigned this Jul 4, 2023
@tamarinvs19 tamarinvs19 requested a review from tochilinak July 10, 2023 07:36
Copy link
Member

@tochilinak tochilinak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine. I think there might be some corner cases with named arguments in magic methods (it is a special case in mypy), it is probably a good idea to add some tests for that too.

@tamarinvs19
Copy link
Collaborator Author

Looks fine. I think there might be some corner cases with named arguments in magic methods (it is a special case in mypy), it is probably a good idea to add some tests for that too.

I added more tests (not only for named arguments) and created script to run test generation. In future we will be able to use this script on GitHub to run tests

@tamarinvs19 tamarinvs19 merged commit f16d5ca into main Jul 27, 2023
@tamarinvs19 tamarinvs19 deleted the tamarinvs19/utbot-python-refactoring branch July 27, 2023 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-codegen Issue is related to code generator ctg-refactoring Issue related to refactoring process lang-python Issue is related to python support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants